A network may include a WLAN mesh network (hereinafter referred to as a wireless mesh network) and an external network. If the wireless mesh network is connected to the external network by using multiple mesh gates, a loop may occur in the network including the wireless mesh network and the external network. The mesh gate refers to a device that has a function of a mesh station and that provides a mesh basic service set (MBSS) with access, for which a wireless medium (WM) is used, to one or more distribution systems. The external network is a distribution system connected to the mesh gate. The external network may be a wired network or a combination of a wired network and a wireless network.
For example, in a network shown in FIG. 1, a wireless mesh network includes a gateway 1, a gateway 2, and multiple mesh stations. Both the gateway 1 and the gateway 2 are mesh gates. An external network connected to the wireless mesh network includes a network switch. The network switch is connected to the gateway 1 and the gateway 2. A broadcast data frame, a multicast data frame, or an unknown unicast data frame sent by the gateway 1 may arrive at the gateway 2 by using the mesh station in the wireless mesh network. Because both the gateway 1 and the gateway 2 are connected to the network switch, the data frame may arrive at the gateway 1 by using the network switch. Consequently, the data frame loops constantly in the wireless mesh network, piles up, and ultimately causes a network storm, that is, causes a loop in the network shown in FIG. 1.
The Institute of Electrical and Electronics Engineers (IEEE) 802.11-2012 protocol specifies that a switching device, for example, a network switch, in an external network uses the Rapid Spanning Tree Protocol (RSTP) to resolve a problem of a loop between a wireless mesh network and the external network. Specifically, RSTP blocks some ports in the network, so that the wireless mesh network and the external network can be connected by using only one mesh gate, thereby resolving the loop problem.
If the loop problem is resolved by using the foregoing method, the wireless mesh network and the external network can be connected by using only one mesh gate. If the wireless mesh network is large in scale, a single mesh gate cannot process data between the large-scale wireless mesh network and the external network in a timely manner. Consequently, congestion occurs at the mesh gate.